简体   繁体   中英

Tree-like Connectors in Table (HTML/CSS/Prototype)

Here's my fiddle: http://jsfiddle.net/DmcEB/54/

I'd like it to looks like this:

在此处输入图片说明

The code should be smart enough to know that it should only create connectors for the rows after the event pick and before the game date.

[ Edit ] code adjusted to allow for 'lastindent' within the table.

var lastCell,remember;
$$('.geniusPicks tr > td:first-child').slice(1,-1)
     .each(
       function(cell) {
         cell = $(cell);
         lastCell = (cell.innerHTML.match(/^@/)
                ? cell.addClassName('indent') 
                : void 0);
        if (remember &&
            remember.innerHTML.match(/^@/) && 
            !cell.innerHTML.match(/^@/)) {
           remember.addClassName('lastindent');
        }
       remember = cell;
});

See jsfiddle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM