Using Span in an ASP table

C

coleenholley

I asked the question yesterday:
HI All :)

I don't know if I will be able to do this type of formatting, but what I
need to do is have a table row where the text wraps (This is easy) the first
line of text is font size 10 pt and the second (wrapped text) is 6 pt. I
know how to create a style sheet to get all of my font one size or the
other, but does any one have any suggestions on how to do this?

Line 1: font size 10pt>Hi, My name is Coleen<font size 10 pt
Line 2: font size 6pt>I need this to be small like a footnote<font size 6pt

Both lines need to be in the SAME table row/cell...

TIA if any one can help, I really appreciate it :)

Coleen

and got this response:
Use :first-line pseudo element in your style sheet. Unless of course it's
you who's wrapping the text, then just put the first line in a span or div
element and set the style on that...

Thanks Jerry, but I tried using Span or DIV inside the tableRow and it is not allowed. If there is away to do this can you please send me an example? Thanks very much :)

Coleen
 
P

psb

<table border="1" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td width="140"><div style="font-size:10pt;">Hi, My name is Coleen</div>
<div style="font-size:6pt;">Hi, My name is Coleen Hi, My name is Coleen Hi,
My name is Coleen</div>
</td>
</tr>
</tbody>
</table>

the width 140 can go anywhere; <table>, <td>,
style="width:140px:font-size..."

now, if you are not allowed to specify a width, you would need to assign
everything an id and do some dhtml;ie, get the legth of the innerHTML and
calculate/approximate the size in pixels, the width, "hi, my name is coleen"
is at 10pt. once you have the width, you could set the style.width property
for the second div tag that has the 6pt text in it. this way you would
almost have to

-p

coleenholley said:
I asked the question yesterday:


and got this response:



Thanks Jerry, but I tried using Span or DIV inside the tableRow and it is
not allowed. If there is away to do this can you please send me an example?
Thanks very much :)
Community Website: http://www.dotnetjunkies.com/newsgroups/
 
C

coleenholley

Thanks P, I'm not sure it this will work though; I am not using an HTML table - I'm using an ASP table. My code in part is

<asp:Table id="tbl_tax_subtotals" runat="server" CssClass="table" Width="100%"
<asp:TableRow
<asp:TableCell Width="10px" HorizontalAlign="Center">13</asp:TableCell
<asp:TableCell Width="170px" HorizontalAlign="left" Font-Size="8pt"
Indexed Tax (From Worksheet 3)</asp:TableCell
<asp:TableCell Width="25px" CssClass="table" HorizontalAlign="Center"></asp:TableCell
</asp:TableRow
</asp:Table

I can of course do a span or a DIV before the table, but not in the middle of a tablerow...can I do what you've suggested in an ASP table? I've tried but must not have the syntax correct, because I get an error that "Could not find any attribute 'div' of element 'TableCell'. I need the font size to be 10 pt for Indexed Tax and 6 pt for (From Worksheet 3) Any suggestions? Thanks! Coleen
 
P

psb

asp tables (web control tables) are just like html table (html controls)
which get spit out as html tables anyhow... even with old-fashioned html
you couldn't put anything between <table>NO<tr> or <tr>NO<td>. The only
text that can be entered would be in the cell or <td>YES</td>. inside here,
you can do anything....

I just put the <div> or <span> between the <asp:tablecell></asp:tablecell>
tags...below is perfectly legal...
<asp:TableCell Width="10px" HorizontalAlign="Center"><span
style="font-size:10pt;">13</span></asp:TableCell>


hope that helps...

Thanks P, I'm not sure it this will work though; I am not using an HTML
table - I'm using an ASP table. My code in part is:
<asp:Table id="tbl_tax_subtotals" runat="server" CssClass="table" Width="100%">
<asp:TableRow>
<asp:TableCell Width="10px"
HorizontalAlign="Center">13 said:
<asp:TableCell Width="170px" HorizontalAlign="left" Font-Size="8pt">
Indexed Tax (From Worksheet 3)</asp:TableCell>
<asp:TableCell Width="25px" CssClass="table"
HorizontalAlign="Center"> said:
</asp:TableRow>
</asp:Table>

I can of course do a span or a DIV before the table, but not in the middle
of a tablerow...can I do what you've suggested in an ASP table? I've tried
but must not have the syntax correct, because I get an error that "Could not
find any attribute 'div' of element 'TableCell'. I need the font size to be
10 pt for Indexed Tax and 6 pt for (From Worksheet 3) Any suggestions?
Thanks! ColeenCommunity Website: http://www.dotnetjunkies.com/newsgroups/
 
C

coleenholley

Yes, Thanks! The problem is that I'm learning ASP.Net, and don't know the exact syntax, so when I tried using Span inside the tablecell, I had the syntax wrong...

Thanks very much for your help - I appreciate it :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top