/    Sign up×
Community /Pin to ProfileBookmark

Align tables with css

Hi,
I have a table in html code. I want to align the whole table a bit inte the screen, for example 20 pixels.

best regards
/Ashley

to post a comment
CSSHTML

4 Comments(s)

Copy linkTweet thisAlerts:
@cootheadAug 04.2021 — Hi there Ashley128,

have you you not considered using CSS for this?

[b]Example[/b]:-

<i>
</i>table {
margin-left: 1.25em;
}



[i]coothead[/i]
Copy linkTweet thisAlerts:
@Ashley128authorAug 04.2021 — Yes, I want to use css for this. If I have the table as a class named members and th, to? How should I write?

best regards

/Ashley
Copy linkTweet thisAlerts:
@NogDogAug 04.2021 — Use .members as the CSS selector if "members" is the assigned class attribute of the relevant &lt;table&gt; tag (or #members is it's the id attribute), instead e.g.:
<i>
</i>.members {
margin-left: 1.25em;
}

/* or to make sure it's only for table elements of that class: */
table.members {
margin-left: 1.25em;
}
Copy linkTweet thisAlerts:
@Ashley128authorAug 04.2021 — Thank you so much. It works.
×

Success!

Help @Ashley128 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...