By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,354 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,354 IT Pros & Developers. It's quick & easy.

Using Span in an ASP table

P: n/a
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... Jerry


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
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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" <coleenholley@-NOSPAM-dmv.state.nv.us> wrote in message
news:eW**************@TK2MSFTNGP09.phx.gbl...
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 divelement and set the style on that...

Jerry


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
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #2

P: n/a
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

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #3

P: n/a
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...

<coleenholley> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #4

P: n/a
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 :-)

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.