PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Draw a box around a group of cells in a table.

 
 
Mr. Magic
Guest
Posts: n/a
 
      16th Nov 2009
I have a table that has about 20 rows with 4 columns. I want to draw a box
around the first 10 rows and all of the columns and then a box around the
next 10 rows and all the columns.

Is there a way to do this as one big table so that all of the columns will
line up or do I need to split it in to two separate tables?

TIA - Jeff.


 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      16th Nov 2009
"Mr. Magic" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Is there a way to do this as one big table so that all of the columns
> will line up or do I need to split it in to two separate tables?


yes.

It really depends on how much work you want to put in this. You can
create your own component that can surround whatever columns and rows
you would like as a separate table. A Repeater is the most flexible
method of doing this.

With a standard grid, you can create margins around parts of the cell
(if you have cell spacing, this will produce an incomplete box,
however). This can be done with the row binding event. You can also cut
up a table with the row binding event, but it will be more complex.

The question, as Mark posed, is how are you outputting your tables. And
the bigger question is what is your desired outcome? Think from the
business perspective and not technology, as the business perspective may
(ie, should) sway the technological means of achieving it.

Peace and Grace,
Greg

--
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
Mr. Magic
Guest
Posts: n/a
 
      16th Nov 2009
I'm just creating a table. Not using from dataset or anything like that.

Just a plain old table used for making the layout look nice.

"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Mr. Magic" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> I have a table that has about 20 rows with 4 columns. I want to draw a
>> box around the first 10 rows and all of the columns and then a box around
>> the next 10 rows and all the columns.
>>
>> Is there a way to do this as one big table so that all of the columns
>> will line up or do I need to split it in to two separate tables?

>
> How are you creating the table...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net


 
Reply With Quote
 
Mr. Magic
Guest
Posts: n/a
 
      17th Nov 2009
It's just a plain old table done in the .aspx code.

You know -

<table>
<tr>
<td>.....


"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:eN8#(E-Mail Removed)...
> "Mr. Magic" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
> [please don't top-post]
>
>>>> I have a table that has about 20 rows with 4 columns. I want to draw a
>>>> box around the first 10 rows and all of the columns and then a box
>>>> around the next 10 rows and all the columns.
>>>>
>>>> Is there a way to do this as one big table so that all of the columns
>>>> will line up or do I need to split it in to two separate tables?
>>>
>>> How are you creating the table...?

>>
>> I'm just creating a table. Not using from dataset or anything like that.
>>
>> Just a plain old table used for making the layout look nice.

>
> :-)
>
> Yes, but *HOW* are you creating the table? Are you writing out the HTML
> markup by hand? Or are you adding rows to a client-side table with
> JavaScript? Or are you building up the HTML dynamically server-side with
> an <asp:Table /> webcontrol? Or....?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net


 
Reply With Quote
 
Andrew Morton
Guest
Posts: n/a
 
      17th Nov 2009
Mr. Magic wrote:
> It's just a plain old table done in the .aspx code.
>
> You know -
>
> <table>
> <tr>
> <td>.....


You could make up the CSS for each type of border (a top-left cell, a top
cell, a top-right cell etc.) and apply it as appropriate.

Andrew


 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      17th Nov 2009
On Nov 17, 5:48*pm, "Mr. Magic" <Muf...@NoWhere.Com> wrote:
> It's just a plain old table done in the .aspx code.
>
> You know -
>
> <table>
> * * <tr>
> * * * * <td>.....
>


if it can be just one big box, separated into 2 parts then you can
simply do following layout. In other case when you want to have 2
boxes then you would need to add more classes to your css (left top
corner, right top corner, etc...)

<style>
table
{
border: 1px solid black
border-collapse:collapse;
}
..r10
{
border-bottom: 1px solid black
}
</style>
<table class="x">
<tr>
<td>.....
</td>
<td>.....
</td>
<td>.....
</td>
</tr>
<tr>
<td>.....
</td>
<td>.....
</td>
<td>.....
</td>
</tr>
<tr>
<td class="r10">.....
</td>
<td class="r10">.....
</td>
<td class="r10">.....
</td>
</tr>
<tr>
<td>.....
</td>
<td>.....
</td>
<td>.....
</td>
</tr>
</table>
 
Reply With Quote
 
Andrew Morton
Guest
Posts: n/a
 
      17th Nov 2009
Andrew Morton wrote:
> You could make up the CSS for each type of border (a top-left cell, a
> top cell, a top-right cell etc.) and apply it as appropriate.


Like this:

<html><head><title></title>
<style type="text/css">

table {
border-collapse:collapse;
}

td {
border: solid 1px gray;
}

..topL {
border-left: solid 3px black;
border-top: solid 3px black;
}

..top {
border-top: solid 3px black;
}

..topR {
border-top: solid 3px black;
border-right: solid 3px black;
}

..left {
border-left: solid 3px black;
}

..right {
border-right: solid 3px black;
}

..bottomL {
border-left: solid 3px black;
border-bottom: solid 3px black;
}

..bottom {
border-bottom: solid 3px black;
}

..bottomR {
border-bottom: solid 3px black;
border-right: solid 3px black;
}
</style></head>
<body>
<table>
<tr>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
</tr>
<tr>
<td class="">&emsp;</td>
<td class="topL">&emsp;</td>
<td class="top">&emsp;</td>
<td class="topR">&emsp;</td>
<td class="">&emsp;</td>
</tr>
<tr>
<td class="">&emsp;</td>
<td class="left">&emsp;</td>
<td class="">&emsp;</td>
<td class="right">&emsp;</td>
<td class="">&emsp;</td>
</tr>
<tr>
<td class="">&emsp;</td>
<td class="bottomL">&emsp;</td>
<td class="bottom">&emsp;</td>
<td class="bottomR">&emsp;</td>
<td class="">&emsp;</td>
</tr>
<tr>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
<td class="">&emsp;</td>
</tr>
</table>
</body>
</html>

HTH,

Andrew


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I draw a connector line between table cells in Office 2007 Adriana Microsoft Powerpoint 1 9th Apr 2008 10:42 PM
Table where I want to draw a border around the whole table but not between the cells. UJ Microsoft ASP .NET 8 12th Jun 2006 07:20 PM
copying text from one group of cells and putting them in a table? cakonopka Microsoft Excel Programming 0 3rd Feb 2004 11:21 AM
Sorting table on a group of cells ? David Microsoft Word Document Management 1 24th Oct 2003 11:38 PM
In Excel - Draw Circles, Ovals, Etc. Around a Group of Cells Without Hiding Cell Contents? JB Microsoft Excel Misc 1 18th Sep 2003 01:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:10 PM.