Formatting the text in a table with CSS
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I need some basic css help. I attempted to style the cells of a table using a css stylesheet, but its not working
The code of the table is:
<table>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
</table>
The only way I got the text to not go to browser defaults was to explicitly state it on every single cell, which seems like a waste of load time (as miniscule as it is). Is there a way to set the size of the text for the entire table? It's is all the same size.
I tried putting the table inside a <p>
and then styling it using a CSS class, but it was not working. Not sure if it matters, but I am using XHTML 1.0.
html css html-table
add a comment |
I need some basic css help. I attempted to style the cells of a table using a css stylesheet, but its not working
The code of the table is:
<table>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
</table>
The only way I got the text to not go to browser defaults was to explicitly state it on every single cell, which seems like a waste of load time (as miniscule as it is). Is there a way to set the size of the text for the entire table? It's is all the same size.
I tried putting the table inside a <p>
and then styling it using a CSS class, but it was not working. Not sure if it matters, but I am using XHTML 1.0.
html css html-table
1
Would this help you?td, td a { font-size:13px; }
– henryaaron
Feb 3 '12 at 20:55
Styles like this are supposed to inherit, so you should be able to put a style attribute in the table tag. jsfiddle Are you saying that doesn't work?
– Mr Lister
Feb 3 '12 at 21:00
1
What exactly isn't working?
– j08691
Feb 3 '12 at 21:12
@MrLister that was not working. Its working now though
– Chris
Feb 3 '12 at 22:08
add a comment |
I need some basic css help. I attempted to style the cells of a table using a css stylesheet, but its not working
The code of the table is:
<table>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
</table>
The only way I got the text to not go to browser defaults was to explicitly state it on every single cell, which seems like a waste of load time (as miniscule as it is). Is there a way to set the size of the text for the entire table? It's is all the same size.
I tried putting the table inside a <p>
and then styling it using a CSS class, but it was not working. Not sure if it matters, but I am using XHTML 1.0.
html css html-table
I need some basic css help. I attempted to style the cells of a table using a css stylesheet, but its not working
The code of the table is:
<table>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
<tr><td><p style="font-size:13px"><a href="mailto:XXX@XXX.XXX">XXX </a></p></td><td><p style="font-size:13px">XXXX </p></td><td><p style="font-size:13px">XXXXXXX </p></td></tr>
</table>
The only way I got the text to not go to browser defaults was to explicitly state it on every single cell, which seems like a waste of load time (as miniscule as it is). Is there a way to set the size of the text for the entire table? It's is all the same size.
I tried putting the table inside a <p>
and then styling it using a CSS class, but it was not working. Not sure if it matters, but I am using XHTML 1.0.
html css html-table
html css html-table
edited Jan 3 at 22:24
Brian Tompsett - 汤莱恩
4,2521339103
4,2521339103
asked Feb 3 '12 at 20:52
ChrisChris
96331226
96331226
1
Would this help you?td, td a { font-size:13px; }
– henryaaron
Feb 3 '12 at 20:55
Styles like this are supposed to inherit, so you should be able to put a style attribute in the table tag. jsfiddle Are you saying that doesn't work?
– Mr Lister
Feb 3 '12 at 21:00
1
What exactly isn't working?
– j08691
Feb 3 '12 at 21:12
@MrLister that was not working. Its working now though
– Chris
Feb 3 '12 at 22:08
add a comment |
1
Would this help you?td, td a { font-size:13px; }
– henryaaron
Feb 3 '12 at 20:55
Styles like this are supposed to inherit, so you should be able to put a style attribute in the table tag. jsfiddle Are you saying that doesn't work?
– Mr Lister
Feb 3 '12 at 21:00
1
What exactly isn't working?
– j08691
Feb 3 '12 at 21:12
@MrLister that was not working. Its working now though
– Chris
Feb 3 '12 at 22:08
1
1
Would this help you?
td, td a { font-size:13px; }
– henryaaron
Feb 3 '12 at 20:55
Would this help you?
td, td a { font-size:13px; }
– henryaaron
Feb 3 '12 at 20:55
Styles like this are supposed to inherit, so you should be able to put a style attribute in the table tag. jsfiddle Are you saying that doesn't work?
– Mr Lister
Feb 3 '12 at 21:00
Styles like this are supposed to inherit, so you should be able to put a style attribute in the table tag. jsfiddle Are you saying that doesn't work?
– Mr Lister
Feb 3 '12 at 21:00
1
1
What exactly isn't working?
– j08691
Feb 3 '12 at 21:12
What exactly isn't working?
– j08691
Feb 3 '12 at 21:12
@MrLister that was not working. Its working now though
– Chris
Feb 3 '12 at 22:08
@MrLister that was not working. Its working now though
– Chris
Feb 3 '12 at 22:08
add a comment |
3 Answers
3
active
oldest
votes
I would add the class to the table:
<table class='myFormat'><tr>....</tr></table>
Then:
table.myFormat tr td { font-size: 13px; }
Can you tell me what browsers this is in?
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
add a comment |
Have you tried:
td { font-size: 13px }
OR
td.myfontsize { font-size: 13px ; }
then using:
class="myfontsize"
applied to your td tags?
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
add a comment |
Change < table> to < table style="font-size: 13px;"> (without spaces). That should change all of the text inside of the table.
Otherwise you can just add a class or id to it.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9135315%2fformatting-the-text-in-a-table-with-css%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I would add the class to the table:
<table class='myFormat'><tr>....</tr></table>
Then:
table.myFormat tr td { font-size: 13px; }
Can you tell me what browsers this is in?
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
add a comment |
I would add the class to the table:
<table class='myFormat'><tr>....</tr></table>
Then:
table.myFormat tr td { font-size: 13px; }
Can you tell me what browsers this is in?
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
add a comment |
I would add the class to the table:
<table class='myFormat'><tr>....</tr></table>
Then:
table.myFormat tr td { font-size: 13px; }
Can you tell me what browsers this is in?
I would add the class to the table:
<table class='myFormat'><tr>....</tr></table>
Then:
table.myFormat tr td { font-size: 13px; }
Can you tell me what browsers this is in?
answered Feb 3 '12 at 21:05
user1086498
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
add a comment |
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
Thanks, it works now.
– Chris
Feb 3 '12 at 22:09
add a comment |
Have you tried:
td { font-size: 13px }
OR
td.myfontsize { font-size: 13px ; }
then using:
class="myfontsize"
applied to your td tags?
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
add a comment |
Have you tried:
td { font-size: 13px }
OR
td.myfontsize { font-size: 13px ; }
then using:
class="myfontsize"
applied to your td tags?
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
add a comment |
Have you tried:
td { font-size: 13px }
OR
td.myfontsize { font-size: 13px ; }
then using:
class="myfontsize"
applied to your td tags?
Have you tried:
td { font-size: 13px }
OR
td.myfontsize { font-size: 13px ; }
then using:
class="myfontsize"
applied to your td tags?
answered Feb 3 '12 at 21:01
Kummer WolfeKummer Wolfe
50329
50329
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
add a comment |
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
I'd prefer not to have to define every single row though...
– Chris
Feb 3 '12 at 22:08
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
Well if you use something like: td { font-size: 13px } that would apply a blanket style to all cells in any table. However make sure that's what you want for the page.
– Kummer Wolfe
Feb 3 '12 at 22:13
add a comment |
Change < table> to < table style="font-size: 13px;"> (without spaces). That should change all of the text inside of the table.
Otherwise you can just add a class or id to it.
add a comment |
Change < table> to < table style="font-size: 13px;"> (without spaces). That should change all of the text inside of the table.
Otherwise you can just add a class or id to it.
add a comment |
Change < table> to < table style="font-size: 13px;"> (without spaces). That should change all of the text inside of the table.
Otherwise you can just add a class or id to it.
Change < table> to < table style="font-size: 13px;"> (without spaces). That should change all of the text inside of the table.
Otherwise you can just add a class or id to it.
answered Feb 3 '12 at 21:25
ZyteXZyteX
1062412
1062412
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9135315%2fformatting-the-text-in-a-table-with-css%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Would this help you?
td, td a { font-size:13px; }
– henryaaron
Feb 3 '12 at 20:55
Styles like this are supposed to inherit, so you should be able to put a style attribute in the table tag. jsfiddle Are you saying that doesn't work?
– Mr Lister
Feb 3 '12 at 21:00
1
What exactly isn't working?
– j08691
Feb 3 '12 at 21:12
@MrLister that was not working. Its working now though
– Chris
Feb 3 '12 at 22:08