9
  <html>
  <tr>
  <td style="padding-left: 5px;padding-bottom:3px; font size="35;""> <b>Datum:</b><br/>
                            November 2010 </td>
  </html>

is my code correct? i would like to increase the font of the first line. Not sure if i have to put 2 "'s here. and it seems it didn't work.

5
  • @RoToRa:I've learned them many years ago & I forgot... it's like when I learned HTML & also forgot..if you don't feel helping here, it's ok. Then don't reply. I mean, I thought this is what the forum is for, to help not only the newbies but also sharing ideas with each other. Commented Oct 7, 2010 at 13:22
  • Bookmark this site: w3schools.com It is a good reference for CSS, and other stuff as well. Commented Oct 7, 2010 at 13:40
  • No, w3schools.com is full of errors and half truths. The specifications make a much better reference than w3schools. Commented Oct 7, 2010 at 16:13
  • — recommending a decent tutorial is helping. (It isn't answering the question, but RoToRa made a comment, not an answer). Commented Oct 7, 2010 at 16:14
  • Jeez! Shed the attitude, guys ! World is made up of all kinds of people !!! Commented Apr 22, 2014 at 14:28

9 Answers 9

17

Try this:

<html>
  <table>
    <tr>
      <td style="padding-left: 5px;
                 padding-bottom: 3px;">
        <strong style="font-size: 35px;">Datum:</strong><br />
        November 2010 
      </td>
    </tr>
  </table>
</html>

Notice that I also included the table-tag, which you seem to have forgotten. This has to be included if you want this to appear as a table.

Sign up to request clarification or add additional context in comments.

8 Comments

this code is also similar with others but this one it's working don't understand why
It is because of the table-tag..:)
what do you mean "table-tag"?
i just wanted to have the font size change in Datum, if i do this the "November" also follows
Oh, I must have misread your question, I have now updated my answer.
|
10
font-size:35px;

So like this:

<html>
  <table>
  <tr>
  <td style="padding-left:5px;padding-bottom:3px;"> 
    <strong style="font-size:35px;">Datum:</strong>
    <br/>
    November 2010 
  </td>
  </tr>
  </table>
</html>

Although inline styles are a bad practice and you should class things. Also you should use a <strong></strong> tag instead of <b></b>

6 Comments

Try that.... I missread your post, now the first line will be bigger than the second.
It is worth pointing out the issues involved with using pixels for font size ( css-discuss.incutio.com/wiki/Using_Pixels ) and advising to use style sheets instead of style attributes. The advice for <strong> Vs <b> doesn't always hold, sometimes font-weight is a better choice than <strong>
@Christ Shouts: you left </tr> from the code..will try this one
@tintincute - That same </tr> was missing from your original post.
@David Dorward: Using <strong> is still advisable over <b> for things like screen readers ect. And yes, controlling the amount of boldness should be done through styling.
|
3

you dont need those quotes

<td style="padding-left: 5px;padding-bottom:3px; font-size: 35px;"> <b>Datum:</b><br/>
                        November 2010 </td>

3 Comments

@tintincute - this should have worked. What exactly is it doing?
@tintincute : this should have worked what kind do you get any kind of change ???
i copied it here and then paste in my code and run into my browser
2

There are a couple of answers posted here that will give you the text effects you want, but...

The thing about tables is that they are organized collections of labels and data. Having both a label ("Datum") and the value that it labels in the same cell is oh so very wrong. The label should be in a <th> element, with the value in a <td> either in the same row or the same column (depending on the data arrangement you are trying to achieve). You can have <th> elements running either vertically or horizontally or both, but if you don't have heading cells (which is what <th> means), you don't have a table, you just have a meaningless grid of text. It would be preferable, too, to have a <caption> element to label the table as a whole (you don't have to display the caption, but it should be there for accessibility) and have a summary="blah blah blah" attribute in the table tag, again for accessibility. So your HTML should probably look a lot more like this:

<html>
  <head>
    <title>Test page with Table<title>
    <style type="text/css">
      th {
        font-size: 35px;
        font-weight: bold;
        padding-left: 5px;
        padding-bottom: 3px;
      }
    </style>
  </head>
  <body>
    <table id="table_1" summary="This table has both labels and values">
      <caption>Table of Stuff</caption>
      <tr>
        <th>Datum</th>
        <td>November 2010</td>
      </tr>
    </table>
  </body>
</html>

That may not be exactly what you want -- it's hard to tell whether November 2010 is a data point or a label from what you've posted, and "Datum" isn't a helpful label in any case. Play with it a bit, but make sure that when your table is finished it actually has some kind of semantic meaning. If it's not a real table of data, then don't use a <table> to lay it out.

Comments

0

Don't need to quote css attributes and you should specify an unit. (You should use an external css file too..!)

Comments

0
<html>        
    <table>
        <tr>
            <td style="padding-left: 5px;padding-bottom:3px; font-size:35px;"> <b>Datum:</b><br/>
            November 2010 </td>
    </table>
</html>

Comments

0

just write the css attributes in a proper manner i.e:

font-size:35px;

Comments

-1

I suggest you use CSS instead, seems like you're going to repeat those lines later on. But to answer your question:

<html>
  <head>
  <style type="text/css">
    td.randname {
        padding-left: 5px;
        padding-bottom:3px;
        font-size:35px;
    }
  </style>
  </head>
  <body>
  <table>
  <tr>
  <td class="randname"> <b>Datum:</b><br/>
                            November 2010 </td></tr>
                            </table>
  </body>
</html>

Comments

-2

The correct CSS for setting font-size is "font-size: 35px". I.e.:

 <td style="padding-left: 5px; padding-bottom:3px; font size: 35px;">

Note that this sets the font size in pixels. You can also set it in *em*s or percentage. Learn more about fonts in CSS here: http://www.w3schools.com/css/css_font.asp

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.