Re: Offtopic: Need help with HTML Table Formatting



Matt Harward wrote:

Generally you wouldn't do this with a table.

I agree, but was the only tag that supported bgcolor except for body.

The same effect can be handled in better ways. Probably the easiest is to use the span tag with inline styles (contrary to what you think, you both need and want css if you want to make this easy). Something like the following should work fine:

<span style="background-color:#FF0000; color:#FFFFFF">white on red</span>

I tried it and it worked. Thanks muchly. :)

Sam




"Sam Larson" <sam212@xxxxxxxxx> wrote in message news:4634311f$1@xxxxxxxxxxxxxxxxxxxxxxxxx

I thought this would be simple, NOT!

All I want to do is color the background of a word that is within a paragraph using HTML. So it could be say white text on a red background.


As an example, I'd like to highlight the words "background" in the previous paragraph. Simple, right? I'm displaying this HTML text in a Delphi THTMLViewer component so I don't need or want CSS.

The only way I can do it is if I insert a table into the paragraph text and use bgcolor="red" for the table (which has only that one word). Ok so this works, but now the table is positioned below the previous word (on a new line). My question is, how do I get the table to be on the same line as the previous word, because I need to highlight several words in a paragraph and the paragraph can't be broken onto a new line everytime it encounters a highlighted word. The highlighted word must run together with the rest of the paragraph.

I can't seem to get around this problem. Can anyone offer some insight? (or how about a shot of whiskey right about now?)

TIA

Sam



.



Relevant Pages

  • Re: preventing line breaks of
    tag
    ... > I'm using <div> tags, ... With CSS you can make this _look_ however you like (but it's ... > without it creating a new paragraph, ... Ignore any HTML "tutorial" ...
    (alt.html)
  • Re: Centered fragment in a paragraph
    ... I'm trying to display a paragraph that has a centered ... For example, if you assign a CSS rule that applies to p elements, it will only be applied to the part that precedes the tag, since by HTML parsing rules, the paragraph ends there. ...
    (comp.infosystems.www.authoring.html)
  • Re: Website design for beginners
    ... at least in terms of html. ... This tells the browser that what follows is the page header. ... This is telling the browser that you're using CSS to set out how you ... CSS tells it that "this paragraph is in Times New Roman, ...
    (alt.html)
  • Re: Offtopic: Need help with HTML Table Formatting
    ... paragraph using HTML. ... Delphi THTMLViewer component so I don't need or want CSS. ... encounters a highlighted word. ...
    (borland.public.delphi.thirdpartytools.general)
  • Offtopic: Need help with HTML Table Formatting
    ... All I want to do is color the background of a word that is within a paragraph using HTML. ... I'm displaying this HTML text in a Delphi THTMLViewer component so I don't need or want CSS. ... My question is, how do I get the table to be on the same line as the previous word, because I need to highlight several words in a paragraph and the paragraph can't be broken onto a new line everytime it encounters a highlighted word. ...
    (borland.public.delphi.thirdpartytools.general)