public function pageContent() { $table = (new Table())->addClass('table', 'table-striped', 'tablesorter'); $thead = new TableHead(); $tbody = new TableBody(); $noTitle = []; $thead->setContent([new TableHeading('Qty'), new TableHeading('Title')]); $table->setContent($thead); foreach ($this->_dvds as $key => $item) { if ($key === 0 && $this->_canAdd) { $tr = new TableRow(); $tr->appendContent([new TableCell(1), new TableCell($this->_editable('title', 'title', ''))]); $tbody->prependContent($tr); } if (!$item->title) { $noTitleRow = new TableRow(); $noTitleRow->appendContent([new TableCell($item->count), new TableCell($this->_editable('title', 'no title', $item->barcode))]); $this->_count--; $noTitle[] = $noTitleRow; } else { $tr = new TableRow(); $tr->appendContent([new TableCell($item->count), new TableCell($this->_editable('title', $item->title, $item->barcode))]); $tbody->appendContent($tr); $this->_count++; } } //$tbody->appendContent($noTitle); return Div::create([HeadingTwo::create(['Dvd Library ', Span::create('count ' . $this->_count)->setAttribute('style', 'font-size: 16px; color: #ccc;')]), $table->appendContent($tbody)]); }